﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace HousingDistribution
{
    class DataTableInvalidDateCell2Null
    {
        public static void Format(ref DataRow dr, string[] cols)
        {
            try
            {
                foreach (string colName in cols)
                {
                    if (Convert.ToDateTime(dr[colName]).CompareTo(DateProc.InvalidDate()) == 0)
                    {
                        dr[colName] = DBNull.Value;
                        Console.WriteLine("DBNull.Value");
                    }
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
    }
}
